#include "mainapplication.h"
#include "appglobal.h"
#include "secondwidget.h"
#include <QDebug>
#include <QApplication>
#include <QTextCodec>

MainApplication *MainApplication::mInstance = nullptr;
MainApplication *MainApplication::getInstance()
{
    if (mInstance == nullptr) {
        mInstance = new MainApplication();
    }
    return mInstance;
}

MainApplication::MainApplication()
{
    qDebug() << "MainApplication()" << endl;
    w = new SecondWidget();
    w->show();
}

MainApplication::~MainApplication()
{
    if (w != nullptr) {
        delete  w;
    }
    qDebug() << "~MainApplication()" << endl;
}

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    MainApplication::getInstance();
    qDebug() << "main(" << argc << "," << argv << ")" << endl;
    return app.exec();
}
